package com.zl.gmadmin.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zl.gmadmin.entity.BlogArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: ZhangLiang
 * @Date: 2021/08/24/12:47
 * @Description:
 */
@Mapper
public interface BlogArticleMapper extends BaseMapper<BlogArticle> {

    @Override
    <E extends IPage<BlogArticle>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<BlogArticle> queryWrapper);

    /**
     * 保存文章和标签中间表
     * @param id
     * @param blogLabelIds
     */
    void insertArticleAndLabel(Long id, List<Long> blogLabelIds);

    void deleteArticleAndLabel(Collection<? extends Serializable> ids);
}
